import time

import pytest,os,logging,yamail
t=time.strftime("%Y%m%d%H%M%S")
def yj(f):
    tt=yamail.SMTP(user='1391277593@qq.com',password='npphtjsegwjqhiae',host='smtp.qq.com')
    tt.send(to='1391277593@qq.com',subject='测试报告',contents='请查收'+t,attachments=f)
def lo():
    logging.basicConfig(filename=t+'.log',level=logging.DEBUG,format='%(filename)s %(asctime)s %(thread)d %(message)s',filemode='a+')
if __name__ == '__main__':
    lo()
    pytest.main(['-s',r'D:\gaowu\pythonProject\zhokao3\Testcase.py','--alluredir=./min','--alluredir-clean'])
    os.system('allure generate ./min -o ./minhtml --clean')
    yj([t+'.log','./minhtml/index.html'])